import request from '@/utils/request'

// 获取文章列表
export const getArticleList = (params) => {
    return request.get('/article', {params});
}

// 添加文章
export const addArticle = (data) => {
    return request.post('/article', data);
}

// 编辑文章
export const editArticle = (data) => {
    return request.put(`/article`, data);
}

// 删除文章
export const deleteArticle = (id) => {
    let params = new URLSearchParams();
    params.append('id', id);
    return request.delete(`/article`, {params});
}